import request from '@/utils/request'
import {parseStrEmpty} from "@/utils/ruoyi";

// 查询task列表
export function listTask(query) {
  return request({
    url: '/system/task/list',
    method: 'get',
    params: query
  })
}
// 查询某患者所有已评估任务列表
export function listAllAssessedTask(query) {
  return request({
    url: '/system/task/listAll',
    method: 'get',
    params: query
  })
}
// 查询 首页-评估（日）的任务列表
export function dayListTask(query) {
  return request({
    url: '/system/task/dayList',
    method: 'get',
    params: query
  })
}
export function dayListTaskByStatus(query) {
  return request({
    url: '/system/task/dayListStatus',
    method: 'get',
    params: query
  })
}

export function dayListTask14(query) {
  return request({
    url: '/system/task/dayList14',
    method: 'get',
    params: query
  })
}
export function dayListTaskByStatus14(query) {
  return request({
    url: '/system/task/dayListStatus14',
    method: 'get',
    params: query
  })
}
// 查询 首页-评估（周）的任务列表
export function weekListTask(query) {
  return request({
    url: '/system/task/weekList',
    method: 'get',
    params: query
  })
}
export function weekListTaskByStatus(query) {
  return request({
    url: '/system/task/weekListStatus',
    method: 'get',
    params: query
  })
}
export function weekListTask14(query) {
  return request({
    url: '/system/task/weekList14',
    method: 'get',
    params: query
  })
}
export function weekListTaskByStatus14(query) {
  return request({
    url: '/system/task/weekListStatus14',
    method: 'get',
    params: query
  })
}

//查询审核功能中的task列表
export function listAuditTask(query) {
  return request({
    url: '/system/task/listAudit',
    method: 'get',
    params: query
  })
}

// 查询团队的审核task列表
export function listAuditByDept(deptId) {
  return request({
    url: '/system/task/listAuditByDept/' + deptId,
    method: 'get',
  })
}

// 查询task列表
export function listTaskalive(query) {
  return request({
    url: '/system/task/listalive',
    method: 'get',
    params: query
  })
}
// 查询团队task列表
export function listTaskByDept(deptId) {
  return request({
    url: '/system/task/listByDept/' + deptId,
    method: 'get',
  })
}

// 查询task详细
export function getTask(taskId) {
  return request({
    url: '/system/task/' + taskId,
    method: 'get'
  })
}

// 新增task
export function addTask(data) {
  return request({
    url: '/system/task',
    method: 'post',
    data: data
  })
}

// 修改task
export function updateTask(data) {
  return request({
    url: '/system/task',
    method: 'put',
    data: data
  })
}

// 删除task
export function delTask(taskId) {
  return request({
    url: '/system/task/' + taskId,
    method: 'delete'
  })
}

// 新增task_data
export function addData(taskId) {
  return request({
    url: '/system/task/data/' + taskId,
    method: 'post',
    data: data
  })
}

// 导出task_data
export function exportTask(query) {
  return request({
    url: '/system/task/export',
    method: 'get',
    params: query
  })
}

export function getText() {
  return request({
    url: '/ocr/getText',
    method: 'get'
  })
}
